import java.io.IOException;
import java.util.AbstractCollection;
import java.util.logging.*;
import java.util.ArrayList;
/**
 * This will plot the health history of a patient on a fancy graph! :D
 * @author Matt Lee
 *
 */
public class PatientHealthHistory{
	private AbstractCollection<Double> weight;

	private double time;
	
	private static Logger patientHealthHistoryLog = 
		Logger.getLogger(PatientHealthHistory.class.getName());
	
	static{
		ConsoleHandler console = new ConsoleHandler();
		console.setLevel(Level.FINEST);
		console.setFormatter(new ThunderDragonHtmlFormatter());
		patientHealthHistoryLog.addHandler(console);
		patientHealthHistoryLog.setLevel(Level.ALL);
		
		try {
			FileHandler fh = new FileHandler("PatientHealthHistoryLog.txt");
			fh.setFormatter(new ThunderDragonHtmlFormatter());
			patientHealthHistoryLog.addHandler(fh);
		} catch (SecurityException e) {
			// TODO Auto-generated catch block
			patientHealthHistoryLog.severe("Failure: Security exception thrown" +
					" when trying to create a new handler" +
					" in PatientHealthHistory.java.");
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			patientHealthHistoryLog.severe("Failure: I/O exception thrown" +
					" when trying to create a new handler" +
					" in PatientHealthHistory.java.");
			e.printStackTrace();
		}
		
	}

	public PatientHealthHistory(ArrayList<Double> myWeight, double myTime){
		patientHealthHistoryLog.entering(this.getClass().getName(),
				"PatientHealthHistory Constructor",
				new Object[] {myWeight, myTime});
		
		weight = new ArrayList<Double>();
		weight = myWeight;
		time = myTime;
		
		patientHealthHistoryLog.exiting(this.getClass().getName(),
				"PatientHealthHistory Constructor");
	}

	/**
	 * This will plot the actual health history on a graphic.
	 */
	public void plot(){
		//Insert code here.
		patientHealthHistoryLog.finest("Called plot() in class PatientHealthHistory.");
	}

	@Override
	public String toString() {
		return "PatientHealthHistory [weight=" + weight + ", time=" + time
				+ "]";
	}
	
	
}